import request from '@/utils/request'
const moduleApi = 'operation'

// 抽奖活动列表
export function getRaffleListApi(params) {
  return request({
    url: moduleApi + `/lottery/lotteryList`,
    method: 'get',
    params
  })
}
// 校验是否可以新增抽奖
export function checkRaffleApi(params) {
  return request({
    url: moduleApi + `/lottery/isUnderway`,
    method: 'get',
    params
  })
}
// 新增抽奖
export function addRaffleApi(data) {
  return request({
    url: moduleApi + `/lottery/addLottery`,
    method: 'post',
    data
  })
}
// 修改抽奖活动
export function updateRaffleApi(data) {
  return request({
    url: moduleApi + `/lottery`,
    method: 'put',
    data
  })
}
// 获取抽奖详情
export function getRaffleDetailApi(id) {
  return request({
    url: moduleApi + `/lottery/${id}`,
    method: 'get'
  })
}
// 抽奖奖品列表
export function getPrizeListApi(params) {
  return request({
    url: moduleApi + `/marCoupon/prizeList`,
    method: 'get',
    params
  })
}
// 库存发放详情列表
export function getsurplusListApi(params) {
  return request({
    url: moduleApi + `/lottery/grantRepertory`,
    method: 'get',
    params
  })
}
// 参与人数列表
export function getJoinListApi(params) {
  return request({
    url: moduleApi + `/lottery/participation`,
    method: 'get',
    params
  })
}
// 参与人数奖品列表
export function getRewardListApi(params) {
  return request({
    url: moduleApi + `/lottery/prizeList`,
    method: 'get',
    params
  })
}
// 参与详情列表
export function getDetailListApi(params) {
  return request({
    url: moduleApi + `/lottery/participationPositionData`,
    method: 'get',
    params
  })
}
// 参与详情列表
export function getDetailTotalApi(params) {
  return request({
    url: moduleApi + `/lottery/participationInfo`,
    method: 'get',
    params
  })
}
